using System;
using System.Text;
using System.Xml.Serialization;

namespace ChordCreator.Services.ConfigurationServices
{
    /// <summary>
    /// This class used to store information about scale displaying
    /// </summary>
    public class ScaleDisplaying
    {
        [XmlAttribute]
        public Note Tonic
        { get; set; }

        [XmlAttribute]
        public string DisplayedTonic
        { get; set; }

        [XmlIgnore]
        public string[] ScalePresentation
        { get; set; }

        [XmlAttribute]
        public string XmlDisplaying
        {
            get
            {
                StringBuilder builder = new StringBuilder();
                foreach (string str in ScalePresentation)
                {
                    builder.Append(str);
                    builder.Append(',');
                }
                return builder.ToString().Trim(',');
            }
            set
            {
                ScalePresentation = value.Split(XmlConfiguration.Seperators, StringSplitOptions.RemoveEmptyEntries);
            }
        }


    }
}